/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.univalle.modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author valentina
 */
@Entity
@Table(name = "ciaenvios")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ciaenvios.findAll", query = "SELECT c FROM Ciaenvios c"),
    @NamedQuery(name = "Ciaenvios.findByIdciaenvios", query = "SELECT c FROM Ciaenvios c WHERE c.idciaenvios = :idciaenvios"),
    @NamedQuery(name = "Ciaenvios.findByNombrecia", query = "SELECT c FROM Ciaenvios c WHERE c.nombrecia = :nombrecia"),
    @NamedQuery(name = "Ciaenvios.findByTelefono", query = "SELECT c FROM Ciaenvios c WHERE c.telefono = :telefono")})
public class Ciaenvios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idciaenvios")
    private Integer idciaenvios;
    @Size(max = 20)
    @Column(name = "nombrecia")
    private String nombrecia;
    @Column(name = "telefono")
    private Integer telefono;
    @OneToMany(mappedBy = "formaenvio")
    private List<Pedidos> pedidosList;

    public Ciaenvios() {
    }

    public Ciaenvios(Integer idciaenvios) {
        this.idciaenvios = idciaenvios;
    }

    public Integer getIdciaenvios() {
        return idciaenvios;
    }

    public void setIdciaenvios(Integer idciaenvios) {
        this.idciaenvios = idciaenvios;
    }

    public String getNombrecia() {
        return nombrecia;
    }

    public void setNombrecia(String nombrecia) {
        this.nombrecia = nombrecia;
    }

    public Integer getTelefono() {
        return telefono;
    }

    public void setTelefono(Integer telefono) {
        this.telefono = telefono;
    }

    @XmlTransient
    public List<Pedidos> getPedidosList() {
        return pedidosList;
    }

    public void setPedidosList(List<Pedidos> pedidosList) {
        this.pedidosList = pedidosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idciaenvios != null ? idciaenvios.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ciaenvios)) {
            return false;
        }
        Ciaenvios other = (Ciaenvios) object;
        if ((this.idciaenvios == null && other.idciaenvios != null) || (this.idciaenvios != null && !this.idciaenvios.equals(other.idciaenvios))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.edu.univalle.modelo.Ciaenvios[ idciaenvios=" + idciaenvios + " ]";
    }
    
}
